home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / langmgr.h < prev    next >
Encoding:
C/C++ Source or Header  |  2009-02-21  |  2.4 KB  |  70 lines

  1. /*
  2. For general Scribus (>=1.3.2) copyright and licensing information please refer
  3. to the COPYING file provided with the program. Following this notice may exist
  4. a copyright and/or license notice that predates the release of Scribus 1.3.2
  5. for which a new license (GPL+exception) is in place.
  6. */
  7. /***************************************************************************
  8.     begin                : Jan 2005
  9.     copyright            : (C) 2005 by Craig Bradney
  10.     email                : cbradney@zip.com.au
  11.  ***************************************************************************/
  12.  
  13. /***************************************************************************
  14.  *                                                                         *
  15.  *   This program is free software; you can redistribute it and/or modify  *
  16.  *   it under the terms of the GNU General Public License as published by  *
  17.  *   the Free Software Foundation; either version 2 of the License, or     *
  18.  *   (at your option) any later version.                                   *
  19.  *                                                                         *
  20.  ***************************************************************************/
  21.  
  22. #ifndef LANGMANAGER_H
  23. #define LANGMANAGER_H
  24.  
  25. #include <QMap>
  26. #include <utility>
  27.  
  28. #include <QString>
  29. #include <QStringList>
  30. #include "scribusapi.h"
  31.  
  32. typedef std::pair<QString, QString> langPair;
  33.  
  34.  
  35.  
  36. class SCRIBUS_API LanguageManager
  37. {
  38.     static LanguageManager* m_instance;
  39.     LanguageManager() {};
  40.     ~LanguageManager();
  41.     void init(bool generateInstalledList = true);
  42.     
  43. public:
  44.     static LanguageManager* instance();
  45.     
  46.     const QString getLangFromAbbrev(QString, bool getTranslated=true);
  47.     const QString getAbbrevFromLang(QString, bool getFromTranslated=true, bool useInstalled=true);
  48.     const QString getLangFromTransLang(QString lang);
  49.     const QString getTransLangFromLang(QString lang);
  50.     void fillInstalledStringList(QStringList *stringListToFill, bool addDefaults);
  51.     void printInstalledList();
  52.     QString numericSequence(QString seq);
  53.     
  54.     void addHyphLang(const QString& lang, const QString& filename);
  55.     const QString getHyphFilename(const QString& lang, bool langIsAbbreviated = true);
  56.     const QStringList hyphLangs();
  57.  
  58. private:
  59.     QMap<QString, langPair > langList;
  60.     QMap<QString, QString> installedLangList;
  61.     QMap<QString, QString> hyphLangList; // <lang abbreviated, dict filename>
  62.  
  63.     void generateLangList();
  64.     void generateInstalledLangList();
  65.     
  66. };
  67.  
  68. #endif
  69.  
  70.